package com.example.momo_01.activity;

import java.util.ArrayList;
import java.util.List;

import com.example.momo_01.adapter.ViewPagerAdapter;
import com.example.momo_01.view.ViewPagerFragment;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
import android.view.Menu;
import android.view.Window;

public class SplashActivity extends FragmentActivity {
	private ViewPager viewPager;
	private ViewPagerAdapter adapter;
	private List<Fragment> list = new ArrayList<Fragment>();
	private FragmentManager fragmentManager;
	
	private void initView(){
		viewPager = (ViewPager) findViewById(R.id.viewpager_splash);
		fragmentManager = this.getSupportFragmentManager();
		for(int i =0;i<4;i++){
			list.add(ViewPagerFragment.newInstance(i));
		}
		adapter = new ViewPagerAdapter(list, fragmentManager, viewPager);
	}
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.layout_splash);
		initView();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.splash, menu);
		return true;
	}

}
